import { createApp } from 'vue'
import './assets/index.css'
import './assets/common.css'
import './lib/bootstrap/bootstrap.min.css'
import './lib/bootstrap/bootstrap-icons.css'
import './assets/common.css'
import App from './App.vue'
import router from './router'

createApp(App).directive('jumpNum', {
  inserted(el, binding) {
    console.log(el, binding)
  },
  updated(el, binding) {
    let target = parseInt(binding.value)
    let curData = 0;
    let t = setInterval(() => {
      let step = (target - curData) / 5
      curData += Math.ceil(step)
      if (curData === target) {
        clearInterval(t)
      }
      el.innerHTML = curData
      console.log('undated', curData)
    }, 50)
  }
}).use(router).mount('#app')
